; ANSO 0.1

Class ANSO
{

	var mY:=48
	var mX:=-8
	var mH:=52
	
	var hY:=0
	var hX:=-8
	var hH:=48
	
	int()
	{
		global
		If !pToken := Gdip_Startup()
		{
			MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
			ExitApp
		}

		DllCall( "GDI32.DLL\AddFontResourceEx", Str,"GenR102.TTF",UInt,(FR_PRIVATE:=0x10), Int,0)
		nHeight    :=  73
		fnWeight   := 400 
		fdwCharSet := 0x1
		lpszFace := "Gentium (Humanized)"
		ANTIALIASED_QUALITY := 0x4
		NONANTIALIASED_QUALITY := 0x3
		hFont1 := DllCall( "CreateFont", Int,nHeight, Int,0, Int,0, Int,0, UInt,fnWeight, Int,0 ,Int,0, Int,0, UInt,fdwCharSet, Int,0, Int,0, Int,ANTIALIASED_QUALITY, Int,0, Str,lpszFace )
		


		Width := a_screenwidth, Height := a_screenheight
		Gui, 1: -Caption  +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
		Gui, 1: Show, NA disable
		hwnd1 := WinExist()
		
		If !hFamily := Gdip_FontFamilyCreate(lpszFace)
		{
			MsgBox, 48, Font error!, The font you have specified does not exist on the system
			ExitApp
		}
		Gdip_DeleteFontFamily(hFamily)
	}
	display_message(msg="",hmsg="")
	{
		global
		hbm := CreateDIBSection(Width, Height)
		hdc := CreateCompatibleDC()
		obm := SelectObject(hdc, hbm)
		G := Gdip_GraphicsFromHDC(hdc)
		if msg
		{
			mY:=this.mY
			rH:=mY+this.mH
			mX:=this.mX
			bc:="0xE6000000"
			this.internal_display(mX, mY, "", rH, msg, bc, "ffffffff", 68, 13)
		}
		if hmsg
		{
			hY:=this.hY
			rhH:=hY+this.hH
			hX:=this.hX
			bc:="0xE6ADC571"
			this.internal_display(hX, hY, "", rhH, hmsg, bc, "ffffffff", 36, 6)
		}
		UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width, Height)
		SelectObject(hdc, obm)
		DeleteObject(hbm)
		DeleteDC(hdc)
		Gdip_DeleteGraphics(G)	
	}
	internal_display(x, y, w="", h="", msg="", bc="", tc="", fs="", pty="")
	{
			global width, height, lpszFace, hwnd1, hbm, hdc, obm, G
			pBrush := Gdip_BrushCreateSolid(bc)
			ty:=y+pty
			Gdip_SetSmoothingMode(G, 4)
			Options = x2 y%ty%  h73  c%tc% s%fs%
			size:=Gdip_TextToGraphics(G, msg, Options, lpszFace, Width, 73,1)
			StringSplit, size, size, |
			FontWidth:=size3+15
			Gdip_FillRoundedRectangle(G, pBrush, x, y, FontWidth, h, 5)
			Gdip_TextToGraphics(G, msg, Options, lpszFace, Width, 73)
			Gdip_DeleteBrush(pBrush)
	}

}





